# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=libretro-blastem
pkgver=2052
pkgrel=2
pkgdesc='Sega Mega Drive core'
arch=(loong64 x86_64)
url=https://github.com/libretro/blastem
license=(GPL3)
groups=(libretro)
depends=(
  glibc
  libretro-core-info
)
makedepends=(git)
_commit=0786858437ed71996f43b7af0fbe627eb88152fc
source=(
  libretro-blastem::git+https://github.com/libretro/blastem.git#commit=${_commit}
  libretro-blastem-flags.patch
)
b2sums=('SKIP'
        '35431a1ad2960c8fdfb266f049291557dc2c4956495f06a87daac7e6e6063d8606eb4abf64cc4e49467178c2e26fc9b5ba29fa43a3351f2f6de8e54c50846740')

prepare() {
  cd libretro-blastem
  patch -Np1 -i ../libretro-blastem-flags.patch
}

pkgver() {
  cd libretro-blastem
  git rev-list --count HEAD
}

build() {
  make -C libretro-blastem -f Makefile.libretro
}

package() {
  install -Dm 644 libretro-blastem/blastem_libretro.so -t "${pkgdir}"/usr/lib/libretro/
}

# vim: ts=2 sw=2 et:
